<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>v-for循环对象数组</title>
    <script src="/js/vue.js"></script>
</head>
<body>
<div id="hcp">
    <p>双重循环对象数组</p>
    <p v-for="(stu,i) in students">
        {{i+1}}号==》
<!--    <span v-for="v in stu">{{v}}&nbsp;</span>-->
        <span v-for="(v,k) in stu">属性名：{{k}}==》属性值：{{v}}<br></span>
    </p>
    <h3>{{ hh() }}</h3>
</div>

<script>
    new Vue({
        el: "#hcp",
        data: {
            students: [
                {
                    name: "胡长攀",
                    age: 18
                },
                {
                    name: "荣耀",
                    age: 3
                },
                {
                    name: "憨憨",
                    age: 10
                },
                {
                    name: "哈哈",
                    age: 16
                },
                {
                    name: "傻傻",
                    age: 8
                }
            ]
        },
        methods: {
            hh: function () {
                return "hello";
            }
        }
    });
</script>
</body>
</html>